<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>热词</title>
	<script src="../../components/echarts-4.0.4.min.js"></script>
    <style>
        body,html{
            padding: 0;
            margin: 0;
			background:#0A0F23;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
	<div style="width: 100%;height: 100%;" id="turnover"></div>
</body>
<script>
    var pieChart = echarts.init(document.getElementById('turnover'));
    var data = [
        {name: "大专",
        value: 4883},
		{name: "本科",
        value: 3968},
		{name: "研究生",
        value: 3648},
		{name: "博士",
		value: 5876}
    ];
    var pieOption = {
        title: {
            text: '专家学历',
            left: 'center',
            top: "5%",
            textStyle: {
                color: '#fff',
                fontSize: 22
            }
        },
        color: ['#0179c4','#0097db','#00a3ac','#029f85','#009f5c','#81bd41','#f44a4a','#ed5f05', '#f29806', '#fdc901','#fdf100','#c0d528'],
        legend: {
            left: '10%',
            top: '15%',
            orient: 'vertical',
            itemGap: 12, //图例每项之间的间隔
            itemWidth: 10,
            itemHeight: 10,
            icon: 'rect',
            data: ['大专', '本科','研究生','博士'],
            textStyle: {
                color: '#fff',
                fontSize: 16
            }
        },
        grid: {
            top: '10%',
            left: '10%',
            bottom: '5%',
            right: '10%',
            containLabel: true
        },
        series: [{
            type: 'pie',
            clockwise: false, //饼图的扇区是否是顺时针排布
            minAngle: 15, //最小的扇区角度（0 ~ 360）
            radius: '50%',
            center: ['60%', '60%'], //饼图的中心（圆心）坐标
            avoidLabelOverlap: true, ////是否启用防止标签重叠
            itemStyle: { //图形样式
                normal: {
                    borderColor: '#fff',
                    borderWidth: 1
                }
            },
            label: { //标签的位置
                normal: {
                    show: true,
                    position: 'inside', //标签的位置
                    formatter: "{d}%",
                    textStyle: {
                        color: '#fff'
                    }
                }
            },
            emphasis: {
                show: true,
                textStyle: {
                    fontWeight: 'bold'
                }
            },
            data: data
        }]
    };

    var currentIndex = -1;
    var timer1 = setInterval(function() {
        var dataLen = pieOption.series[0].data.length;
        // 取消之前高亮的图形
        pieChart.dispatchAction({
            type: 'downplay',
            seriesIndex: 0,
            dataIndex: currentIndex
        });
        currentIndex = (currentIndex + 1) % dataLen;
        // 高亮当前图形
        pieChart.dispatchAction({
            type: 'highlight',
            seriesIndex: 0,
            dataIndex: currentIndex
        });
    }, 1000);
    pieChart.setOption(pieOption);
</script>
</html>